var t = getApp();

Page({
    data: {
        balance: 0,
        listData: [],
        coin_name: "",
        usable: 0
    },
    onLoad: function(t) {
        this.getUsable(), this.getBalance();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getUsable: function() {
        var a = this, n = t.getNetAddresss("plugin.coin.Frontend.Controllers.page.index");
        t._getNetWork({
            url: n,
            success: function(t) {
                1 === t.data.result ? (a.setData({
                    usable: t.data.data.usable,
                    coin_name: t.data.data.coin_name
                }), wx.setNavigationBarTitle({
                    title: t.data.data.coin_name ? t.data.data.coin_name + "激活记录" : "激活记录"
                })) : wx.showToast({
                    title: t.data.msg,
                    icon: "none"
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    goDetailed: function(t) {
        console.log(t, "详情"), wx.navigateTo({
            url: "/packageB/member/love_activation/love_activation?id=" + t.currentTarget.dataset.id || t.target.dataset.id
        });
    },
    getBalance: function() {
        var a = this, n = t.getNetAddresss("plugin.coin.Frontend.Modules.Coin.Controllers.activation-records.index");
        t._getNetWork({
            url: n,
            success: function(t) {
                1 == t.data.result ? a.setData({
                    listData: t.data.data.data
                }) : wx.showToast({
                    title: t.data.msg,
                    icon: "none"
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    }
});